#pragma once

#include <AST/expr/var/VarAST.hpp>

class Struct : public Var {
  protected:
    using StructType = llvm::StructType;
    using VarVector = llvm::SmallVector<Var *>;
    VarVector varList;

  public:
    Struct(string name, llvm::SmallVector<Expr *> varList);

    virtual Value *codegen() override;

    // virtual Value *refCodegen();

    // const string &getName() const;

    // virtual AllocaInst *createEntryAlloca(Function *fun);

    // virtual AllocaInst *createAlloca();

    friend class graphviz::GraphGenerator;

    virtual VisitResult accept(ASTVisitor &visitor) const override {
        return visitor.visitStructAST(this);
    }

  protected:
    // virtual Value *valCodegen();

    // virtual Value *defCodegen();

    // virtual Type *updateTypeByVal(const Value *val);

    // virtual Type *updateTypeByPtr(const Value *ptr);
};